home *** CD-ROM | disk | FTP | other *** search
/ Delphi Magazine Collection 2001 / Delphi Magazine Collection 20001 (2001).iso / DISKS / Issue24 / classtrp / UNIT1.PAS < prev   
Encoding:
Pascal/Delphi Source File  |  1997-06-02  |  633 b   |  40 lines

  1. unit Unit1;
  2.  
  3. interface
  4.  
  5. uses
  6.   Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
  7.   StdCtrls;
  8.  
  9. type
  10.   TForm1 = class(TForm)
  11.     Memo1: TMemo;
  12.   private
  13.     { DΘclarations privΘes }
  14.   public
  15.     { DΘclarations publiques }
  16.   end;
  17.  
  18. var
  19.   Form1: TForm1;
  20.  
  21. implementation
  22.  
  23. uses
  24.   ObjTraps;
  25.  
  26. {$R *.DFM}
  27.  
  28. procedure MemoTrap(const trap: TClassTrap; const obj: TObject;
  29.   op: TObjectOperation);
  30. begin
  31.   if op = ooCreate then
  32.     MessageBox(0, 'TMemo created', '', MB_OK)
  33.   else
  34.     MessageBox(0, 'TMemo freed', '', MB_OK);
  35. end;
  36.  
  37. initialization
  38.   MakeTraps([TMemo], MemoTrap);
  39. end.
  40.